Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue CRM-13089 #1206

Conversation

mmikitka
Copy link
Contributor

Patch for CRM-13089

----------------------------------------
* CRM-13089: CRM_Core_BAO_CustomField::create overrides user-defined name parameter values
  http://issues.civicrm.org/jira/browse/CRM-13089
@ghost ghost assigned totten Jul 20, 2013
@totten
Copy link
Member

totten commented Jul 20, 2013

  1. I like the new behavior - seems sensible.
  2. The patch appears to work with the custom-data imports (no visible errors when installing CiviHR - and the schema/metadata look right in DB).
  3. When creating a new "Alphanumeric->Select" field through the web UI in PHP 5.4, it raises an error because $columnName is no longer defined:
    Notice: Undefined variable: columnName in CRM_Core_BAO_CustomField::create() (line 205 of /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).
    Notice: Undefined variable: columnName in CRM_Core_BAO_CustomField::create() (line 290 of /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).

The new option-group is consequently misnamed (e.g. "_20130720031447" instead of "myfield_20130720031447").

  1. The unit-tests (CRM_Core_BAO_CustomFieldTest, api_v3_CustomFieldTest) regressed. This might be a consequence of the above or might be an issue with the tests relying on the old behavior.

@mmikitka
Copy link
Contributor Author

Thanks for the feedback, Tim. I won't be able to investigate issue #3 and
#4 (option-group) till next week.

matt

On Fri, Jul 19, 2013 at 9:21 PM, Tim Otten notifications@github.com wrote:

I like the new behavior - seems sensible.
2.

The patch appears to work with the custom-data imports (no visible
errors when installing CiviHR - and the schema/metadata look right in DB).
3.

When creating a new "Alphanumeric->Select" field through the web UI in
PHP 5.4, it raises an error because $columnName is no longer defined:

Notice: Undefined variable: columnName in CRM_Core_BAO_CustomField::create() (line 205 of /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).
Notice: Undefined variable: columnName in CRM_Core_BAO_CustomField::create() (line 290 of /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).

The new option-group is consequently misnamed (e.g. "_20130720031447"
instead of "myfield_20130720031447").

  1. The unit-tests (CRM_Core_BAO_CustomFieldTest,
    api_v3_CustomFieldTest) regressed. This might be a consequence of the above
    or might be an issue with the tests relying on the old behavior.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1206#issuecomment-21285959
.

@mmikitka
Copy link
Contributor Author

mmikitka commented Aug 9, 2013

@totten Please see the latest patch which should address the issues observed in your testing.

@ghost ghost assigned totten Aug 9, 2013
@totten totten merged commit 8001040 into civicrm:master Aug 9, 2013
@totten
Copy link
Member

totten commented Aug 9, 2013

I merged manually and made a couple more changes:

  • 79f68e4 - We still need to concatenate the ID# when auto-generating the column name. IIRC, the search system breaks down when columns don't have unique names, and the concatenated ID# protects us from that.
  • 43ff319 - Add test-case for the situation in CRM-13089 (ie when the "name" is explicitly set)

@mmikitka mmikitka deleted the crm-13089-CRM_Core_BAO_CustomField_overrides_name branch August 11, 2013 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants